from django.contrib.auth.models import Group
from rest_framework.generics import ListAPIView
from rest_framework.viewsets import ModelViewSet
from apps.users.models import User
from apps.meiduo_admin.paginations import MyPage
from apps.meiduo_admin.serializers.admin_serialziers import AdminGroupSerializer, AdminUserSerializer


class AdminGroupView(ListAPIView):
    queryset = Group.objects.all()
    serializer_class = AdminGroupSerializer

class AdminUserView(ModelViewSet):

    queryset = User.objects.filter(is_staff=True)
    serializer_class = AdminUserSerializer
    pagination_class = MyPage